#include <iostream>
#include <time.h>
using namespace std;
string get_now_timestamp()
{
    time_t t = time(nullptr);
    char buf[64];
    strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&t));
    return buf;
}

int main()
{
    cout << get_now_timestamp() << endl;
    return 0;
}

/* 运行结果:
2024-10-17 19:38:02

 */